#!/usr/bin/env node

const fs = require('fs');

const src = process.argv[2];
const dst = process.argv[3];

try {
  const readStream = fs.createReadStream(src);
  const writeStream = fs.createWriteStream(dst, { mode: fs.statSync(src).mode });

  readStream.pipe(writeStream);
  writeStream.on('finish', () => {
    console.log('File copied successfully');
  });
} catch (err) {
  console.error('Error copying file:', err.message);
}